{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "369c653e",
   "metadata": {},
   "source": [
    "第1题 ： '有一个数列，是从1 到100 的连续整数。每次擦去前两个整数，并把它们的和加到队尾。重复以上操作，当数列还剩9 个数时，输出这个数列。\n",
    "\n",
    "【输入格式】\n",
    "无\n",
    "\n",
    "【输出格式】\n",
    "1 个列表，列表中有9 个整数\n",
    "\n",
    "【输入样例】\n",
    "无\n",
    "\n",
    "【输出样例（注意：以下列表只做示例，不是最终答案）】\n",
    "[1, 2, 3, 4, 5, 6, 7, 8, 9]'''"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "7150b1b6",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "初始化： [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100]\n",
      "结果： [484, 548, 612, 676, 740, 430, 264, 520, 776]\n"
     ]
    }
   ],
   "source": [
    "ls=[]\n",
    "for i in range(1,101):\n",
    "    ls.append(i)\n",
    "print('初始化：', ls)\n",
    "\n",
    "while True:\n",
    "    ls.append(ls[0]+ls[1])\n",
    "    ls.pop(0)\n",
    "    ls.pop(0)\n",
    "    if len(ls) <=9:\n",
    "        break\n",
    "print('结果：', ls)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bc60881f",
   "metadata": {},
   "source": [
    "'''第2题 ：定义一种新运算：a ▲ b ，规则如下：\n",
    "\n",
    "1）如果a >= b，则a ▲ b = a - b\n",
    "\n",
    "2）如果a < b，则a ▲ b = a + b\n",
    "\n",
    "请输出(2 ▲ (4 ▲ (6 ▲ (8 ▲ (............ ▲(196 ▲ (198 ▲200)))))......)\n",
    "  \n",
    "输入：无\n",
    "\n",
    "输出格式：一行，一个正整数表示运算结果'''"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f2d2d6ec",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
